{% extends "base.html" %}
{% block title %}{{ lang.menu_links.versions.h2 }} {{ lang.words[service] }}{% endblock %}
{% block h2 %}{{ lang.menu_links.versions.h2 }} {{ lang.words[service] }}{% endblock %}
{% block content %}
{% if g.user_params['servers']|length == 0 %}
	{% include 'include/getstarted.html' %}
{% else %}
<link href="{{ url_for('static', filename='css/table-6.3.9.css') }}" rel="stylesheet" type="text/css">
<script type="text/javascript" charset="utf8" src="/inc/dataTables.min.js"></script>
	<p>
		<form action="{{ action }}" method="post" class="left-space">
			<input type="hidden" value="{{service}}" name="service" id="service">
			{{ select('serv', values=g.user_params['servers'], is_servers='true', selected=serv) }}
				<a class="ui-button ui-widget ui-corner-all" title="Open versions" onclick="showListOfVersion(1)">{{lang.words.open|title()}}</a>
				<a href="/app/config/{{service}}" class="ui-button ui-widget ui-corner-all" title="Configs page">{{lang.words.configs|title()}}</a>
			{% if service != 'keepalived' %}
				<a class="ui-button ui-widget ui-corner-all" title="View stat" onclick="openStats()">{{lang.words.stats|title()}}</a>
			{% endif %}
		</form>
	</p>
	{% if aftersave %}
		<div class="alert alert-info"><b>{{lang.phrases.files_been_deleted}}:</b><br /> </div>
		{% if stderr %}
			{% include 'include/errors.html' %}
		{% else %}
			<div class="alert alert-success" style="margin-left: var(--indent);">
			{% for f in file %}
				{{f}}
			{% endfor %}
			</div>
		{% endif %}
	{% endif %}
	<div id="config_version_div"></div>
	{% if not aftersave %}
		<div class="add-note addName alert-info" style="width: inherit; margin-right: 15px; margin-top: 40%">
			{{lang.phrases.work_with_prev}} {{ service[0]|upper}}{{service[1:] }}. {{lang.phrases.roll_back}}
		</div>
	{% endif %}
	{% if serv and not aftersave %}
	{% for select in g.user_params['servers'] %}
		{% if select.2 == serv %}
			<script>showListOfVersion(1)</script>
		{% endif %}
	{% endfor %}
	{% endif %}
{% endif %}
{% endblock %}
